package com.ndp.fb.enums.customaudience;

import lombok.Getter;

/**
 * Created by elvisxiong on 15/11/12.
 */
@Getter
public enum CustomAudienceDataSourceSubType {

    /**Research poll, experiment, etc*/
    ANYTHING(1,"ANYTHING"),
    /**Folder*/
    NOTHING(2,"NOTHING"),
    /**Email hashes or phone hashes*/
    HASHES(3,"HASHES"),
    /**Facebook user ids*/
    USER_IDS(4,"USER_IDS"),
    /**Email/phone hashes or user ids */
    HASHES_OR_USER_IDS(5,"HASHES_OR_USER_IDS"),
    /**Platform IDs or IDFAs */
    MOBILE_ADVERTISER_IDS(6,"MOBILE_ADVERTISER_IDS"),
    /**Including legacy tokens */
    EXTERNAL_IDS(7,"EXTERNAL_IDS"),
    /**Created from multiple types of hashes at the same time */
    MULTI_HASHES(8,"MULTI_HASHES"),
    /**Events reported by Facebook pixels on websites */
    WEB_PIXEL_HITS(9,"WEB_PIXEL_HITS"),
    /**Events reported on mobile platforms */
    MOBILE_APP_EVENTS(10,"MOBILE_APP_EVENTS"),
    /**A composite audience from one or more inclusion and exclusion audiences, e.g. people who performed two or more tracked actions inside the app. */
    MOBILE_APP_COMBINATION_EVENTS(11,"MOBILE_APP_COMBINATION_EVENTS"),
    /**Reports from video views, e.g. 3% or 95% of video has been watched */
    VIDEO_EVENTS(12,"VIDEO_EVENTS"),
    /**A composite audience of one or more inclusion and exclusion audiences, e.g. an audience of people who have viewed the homepage but not completed the sign up process. */
    WEB_PIXEL_COMBINATION_EVENTS(13,"WEB_PIXEL_COMBINATION_EVENTS"),
    /**Created from user ids */
    CUSTOM_AUDIENCE_USERS(14,"CUSTOM_AUDIENCE_USERS"),
    /**Created from page fans */
    PAGE_FANS(15,"PAGE_FANS"),
    /**Created from conversions tracked by Facebook's pixel */
    CONVERSION_PIXEL_HITS(16,"CONVERSION_PIXEL_HITS"),
    /**Users from the mobile app */
    APP_USERS(17,"APP_USERS"),
    /** Created from a saved target group*/
    S_EXPR(18,"S_EXPR"),
    /**Created from emails imported from Mailchimp */
    MAIL_CHIMP_EMAIL_HASHES(19,"MAIL_CHIMP_EMAIL_HASHES"),
    /**Created from emails imported from Constant Contact */
    CONSTANT_CONTACTS_EMAIL_HASHES(20,"CONSTANT_CONTACTS_EMAIL_HASHES"),
    /**Emails entered manually via Ads Manager */
    COPY_PASTE_EMAIL_HASHES(21,"COPY_PASTE_EMAIL_HASHES"),
    /**Get in touch with the importer */
    CONTACT_IMPORTER(22,"CONTACT_IMPORTER");
    private int code;
    private String type;

    private CustomAudienceDataSourceSubType(int code,String type){
        this.code = code;
        this.type = type;
    }

    public static CustomAudienceDataSourceSubType getType(String status) {
        for (CustomAudienceDataSourceSubType c : CustomAudienceDataSourceSubType.values()) {
            if (c.type.equals(status)) {
                return c;
            }
        }
        return null;
    }
}
